package com.sgam.mf.domain.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.springframework.format.annotation.DateTimeFormat;

import com.sgam.utils.CustomDateDeserializer;
import com.sgam.utils.CustomDateSerializer;

@Entity
@Table(name = "REG_PARTNERS")
public class RegPartners {


	@Id
	@Column(name = "id")
	@GeneratedValue
	private Integer id;
	
	@Column(name = "idno")
    private String idno;
	 
	@Column(name = "company_name")
    private String companyName;
	
//	@JsonSerialize(using = CustomDateSerializer.class)
//	@JsonDeserialize(using = CustomDateDeserializer.class)
//	@DateTimeFormat(pattern="dd.MM.yyyy")
//	@Column(name = "foundation_date")
//    private Date foundationDate;
	
	
	@Column(name = "boss_name_surname")
    private String bossNameSurname;
	
	
//	@JsonSerialize(using = CustomDateSerializer.class)
//	@JsonDeserialize(using = CustomDateDeserializer.class)
//	@DateTimeFormat(pattern="dd.MM.yyyy")
//	@Column(name = "boss_birth_date")
//    private Date bossBirthDate;
	
	
	@Column(name = "address")
    private String address;
 
	@Column(name = "juridic_address")
    private String juridicAddress;	

	@Column(name = "emal")
    private String emal;	
	
	@Column(name = "phone_mob")
    private String phoneMob;
	
	@Column(name = "phone_serv")
    private String phoneServ;
	
	@Column(name = "skype")
    private String skype;
	
	@Column(name = "company_site")
    private String companySite;
	
	
	@Column(name = "goods_services")
	private String goodsServices;
	
	@Column(name = "PROCENT")
	private Integer procent;
	
	@OneToMany(cascade = CascadeType.ALL, fetch=FetchType.EAGER, orphanRemoval=true)
	@Fetch(value = FetchMode.SUBSELECT)
	@JoinColumn(name="parent_id_fk")
	private List<RegPartnersAss> regPartnersAss =  new ArrayList<RegPartnersAss>();

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getIdno() {
		return idno;
	}

	public void setIdno(String idno) {
		this.idno = idno;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}



	public String getBossNameSurname() {
		return bossNameSurname;
	}

	public void setBossNameSurname(String bossNameSurname) {
		this.bossNameSurname = bossNameSurname;
	}



	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getJuridicAddress() {
		return juridicAddress;
	}

	public void setJuridicAddress(String juridicAddress) {
		this.juridicAddress = juridicAddress;
	}

	public String getEmal() {
		return emal;
	}

	public void setEmal(String emal) {
		this.emal = emal;
	}

	public String getPhoneMob() {
		return phoneMob;
	}

	public void setPhoneMob(String phoneMob) {
		this.phoneMob = phoneMob;
	}

	public String getPhoneServ() {
		return phoneServ;
	}

	public void setPhoneServ(String phoneServ) {
		this.phoneServ = phoneServ;
	}

	public String getSkype() {
		return skype;
	}

	public void setSkype(String skype) {
		this.skype = skype;
	}

	public String getCompanySite() {
		return companySite;
	}

	public void setCompanySite(String companySite) {
		this.companySite = companySite;
	}

	public String getGoodsServices() {
		return goodsServices;
	}

	public void setGoodsServices(String goodsServices) {
		this.goodsServices = goodsServices;
	}

	public Integer getProcent() {
		return procent;
	}

	public void setProcent(Integer procent) {
		this.procent = procent;
	}

	public List<RegPartnersAss> getRegPartnersAss() {
		return regPartnersAss;
	}

	public void setRegPartnersAss(List<RegPartnersAss> regPartnersAss) {
		this.regPartnersAss = regPartnersAss;
	}

	
}


 

